/**
 * Copyright (c) 2013-Now http://dreamcode123321.com All rights reserved.
 */
package com.jeesite.modules.ab.entity;

import javax.validation.constraints.NotBlank;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotNull;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.entity.TreeEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 小区楼宇Entity
 * @author dc
 * @version 2020-07-12
 */
@Table(name="ab_floor_tree", alias="a", columns={
		@Column(name="floor_code", attrName="floorCode", label="节点编码", isPK=true),
		@Column(includeEntity=TreeEntity.class),
		@Column(name="floor_name", attrName="floorName", label="名称", queryType=QueryType.LIKE, isTreeName=true),
		@Column(includeEntity=DataEntity.class),
		@Column(name="area_code", attrName="areaCode", label="区域编码", isQuery=false),
		@Column(name="area_name", attrName="areaName", label="所属区域", queryType=QueryType.LIKE),
		@Column(name="lon", attrName="lon", label="经度", isQuery=false),
		@Column(name="lat", attrName="lat", label="纬度", isQuery=false),
		@Column(name="unit_count", attrName="unitCount", label="单元数", isQuery=false),
		@Column(name="floor_count", attrName="floorCount", label="楼层数", isQuery=false),
	}, orderBy="a.tree_sorts, a.floor_code"
)
public class AbFloorTree extends TreeEntity<AbFloorTree> {
	
	private static final long serialVersionUID = 1L;
	private String floorCode;		// 节点编码
	private String floorName;		// 名称
	private String areaCode;		// 区域编码
	private String areaName;		// 所属区域
	private Double lon;		// 经度
	private Double lat;		// 纬度
	private Long unitCount;		// 单元数
	private Long floorCount;		// 楼层数
	
	public AbFloorTree() {
		this(null);
	}

	public AbFloorTree(String id){
		super(id);
	}
	
	@Override
	public AbFloorTree getParent() {
		return parent;
	}

	@Override
	public void setParent(AbFloorTree parent) {
		this.parent = parent;
	}
	
	public String getFloorCode() {
		return floorCode;
	}

	public void setFloorCode(String floorCode) {
		this.floorCode = floorCode;
	}
	
	@NotBlank(message="名称不能为空")
	@Length(min=0, max=200, message="名称长度不能超过 200 个字符")
	public String getFloorName() {
		return floorName;
	}

	public void setFloorName(String floorName) {
		this.floorName = floorName;
	}
	
	@NotBlank(message="区域编码不能为空")
	@Length(min=0, max=64, message="区域编码长度不能超过 64 个字符")
	public String getAreaCode() {
		return areaCode;
	}

	public void setAreaCode(String areaCode) {
		this.areaCode = areaCode;
	}
	
	@Length(min=0, max=100, message="所属区域长度不能超过 100 个字符")
	public String getAreaName() {
		return areaName;
	}

	public void setAreaName(String areaName) {
		this.areaName = areaName;
	}
	
	@NotNull(message="经度不能为空")
	public Double getLon() {
		return lon;
	}

	public void setLon(Double lon) {
		this.lon = lon;
	}
	
	@NotNull(message="纬度不能为空")
	public Double getLat() {
		return lat;
	}

	public void setLat(Double lat) {
		this.lat = lat;
	}
	
	public Long getUnitCount() {
		return unitCount;
	}

	public void setUnitCount(Long unitCount) {
		this.unitCount = unitCount;
	}
	
	public Long getFloorCount() {
		return floorCount;
	}

	public void setFloorCount(Long floorCount) {
		this.floorCount = floorCount;
	}
	
}